package com.just.sx.demo;

import java.util.Date;

/**
 * @author xiao.shu
 * @date on 2020/11/24 17:50
 * @description
 * @Copyright (c)
 */
public class MyRunnable implements Runnable {

    private String s;

    public MyRunnable(String s) {

        this.s = s;
    }

    @Override
    public void run() {
        System.out.println("当前线程为:" + Thread.currentThread().getName() + "   " + new Date());


        processCommand();

        System.out.println("当前线程1为:" + Thread.currentThread().getName() + "   " + new Date());

    }


    private void processCommand() {
        try {
            Thread.sleep(50000);
        } catch (InterruptedException e) {
            System.out.println("======" + e.getMessage());
        }
    }

}
